TVToys Version 1.5 December 1993 Far Niente Productions Contents Ü ßßßßßßßßßßßßß Introduction Copyright Short Description Package File List Instructions Porting Suggestions Turbo Pascal 6.0 Users Compatibility Testing Coding Style Protected Mode Information Overlay Information PC Video Modes Video 7 The Improved Help File Extended Video Mode Support Code Custom Fonts The NewMouse Unit EXE Stream Unit Serial Performance Serial Code VideoModeChanged Variable Changes Credits Author, Support, Info, Bugs etc To Do List Introduction Ü ßßßßßßßßßßßßßßßßß Welcome to TVToys! This is a collection of useful stuff that should be available to all Turbo Vision programmers. It is intended for Turbo Pascal 7.0 but would be possible to port to TP6. The font, palette and video mode code can be used in plain text mode without Turbo Vision. THE SOURCE IS FREE AND COMES WITH NO WARRANTIES WHATSOEVER. I hope that you will find this package useful. Have fun with it! Copyright Ü ßßßßßßßßßßßßßß You may use this package for free and pass it on to other persons as long as you clearly state, in the header as well as in the code, all changes made to the original code. You may not pass along compiled versions of the source, except as executable files. You may also upload this package, unmodified, to bulletin boards or other public access places. There must be no charge associated with this package, though you may include the unmodified package as a whole in shareware/freeware compilations if only a nominal amount is charged for the compilation disk. I strongly urge people with money to spare to donate a small token of appreciation in the $20 range. That's 5 campus meals for me. Short Description Ü ßßßßßßßßßßßßßßßßßßßßßß This package includes: An improved Help viewer with back tracking and the possibility to add Contents and Index pages or whatever without recompiling HelpFile. Extended video mode support. Code that determines what video modes are available and presents a list for the user to choose from. Video7 and VESA support included. Custom fonts. Support for three different font file formats. Palette routines. Change the EGA/VGA palette. A mouse unit that limits the effects of buggy mouse drivers in extended video modes. Three demonstration programs, personal configuration files. Lots of commented code, tried and tested. Package File List Ü ßßßßßßßßßßßßßßßßßßßßßß The package consists of the following files: TOYAPP.PAS The fast way to incorporate TVToys in your own app. HELPFILE.PAS Improved HelpFile with back tracking and external commands HELPTEST.PAS Demonstration of HelpFile HELPCTX.PAS Help contexts generated by TVHC HELPTEST.HLP Demo Help text compiled with TVHC HELPTEST.TXT The Help text source VIDEO.PAS A unit supporting extended video mode setting and searching MODEDLG.PAS Dialog for presenting and selecting video modes TVVIDEO.PAS TV support for all the new video modes VIDEOTST.PAS Demonstration of Video, ModeDlg and TVVideo IMPRTANT.PAS Warning dialog used by VideoTst FONTFILE.PAS Custom font file loading and storing FONTDLG.PAS Custom font file selection dialog CHIC12.COM Very nice font to get you going! DBLSTR.PAS Special string class used by font file selection listbox COLORBOX.PAS Color selection box with a twist PAL.PAS EGA/VGA palette handling TVPAL.PAS TV palette changing dialog SCROLL.PAS Scrollbar with instantanious dragging updates RESTEST.PAS Demonstrates streams, resource fonts, safer video detection CHECKVT.PAS Automatic video detection choice dialog SERIAL.PAS Serial stream COMSLECT.PAS COM port selection dialog SERTEST.PAS Simple serial test program NEWMOUSE.PAS Snap in replacement mouse cursor for extended video modes COLORTXT.PAS Enhanced static texts with color. Mini shadows EXESTRM.PAS Stream that reads resources from your EXE TOYCFG.PAS Your personal code preferences file TOYPREFS.PAS Your personal constants preferences file TOYUTILS.PAS Odd Pascal code, hex conversion, file and string stuff TVUTILS.PAS Odd TV bits, validators and routines STRMREC.PAS All the stream records in one unit DPMI.PAS DPMI assembler programming simplification code VESA.PAS VESA support routines TIP.TXT Assortment of unrelated information. README.TXT This text. Instructions Ü ßßßßßßßßßßßßßßßßß There are two demo programs, VIDEOTST and HELPTEST. All you have to do is compile and run them for a quick demonstration. There is also a RESTEST program demonstrating some advanced TVToys programming. If you are upgrading from a previous version, check the Changes and Porting sections in this file. All conditionals controlling conditional compilation are now gathered in one central file called TOYCFG.PAS, which you should edit to your liking. TOYAPP makes it easy to add TVToys to your own programs. If your mouse behaves oddly at times when running VIDEOTST, try defining UseNewMouse in TOYCFG. (The mouse cursor jumps around when you change video modes, but that's because the cursor stays at the same position relative to the upper left corner) If you use VIEWS.TPU/TPP as shipped by Borland, you can try to define Color before compiling and running VIDEOTST.PAS. This spiffs up the Info Dialog and demonstrates ColorTxt. Conventions: The file TOYAPP contains the unit toyApp which defines the object (class) TToyApp. Files are .PAS if nothing else is stated. A "section" is a part of this file, having the section name for header. Read the header in each source file to get more information, VIDEOTST.PAS especially. Porting Ü ßßßßßßßßßßßß News flash: TVTOYS DOES NOT SUPPORT smFont8x8 and smSpecialFont8x8, MAKE SURE YOU REMOVE all such references. There is a ToggleVideoLines function instead. smFont8x8 loses its use with all the new video modes. You have to EXPLICITLY set the VideoModeChanged pointer to a font and palette reloading procedure, see the VideoModeChanged section. I am pro choice, which means that I try to give you the choice of using a certain feature or not. This means that you have to do some editing to incorporate the code in your own apps. TToyApp is an attempt at easing the pains for you. If you use TToyApp, you are stuck with the HelpFile and most of the video code. Even if your application doesn't use Help, ALL the Help code will be compiled into the application. I believe in making TToyApp provide basic services, and the application itself handling menu choices etc, but it gets tedious copying so I decided to burn some things into TToyApp anyway. The way I see it, you have to copy some of the HandleEvent from VideoTst (but you have to edit that code anyway) and create some menus. The menus include the problem of assigning command values, so I have refrained from supplying default constructors like StdEditMenuItems. You are welcome to write your own. The dialogs now all have help contexts. By default, dummy values from TOYPREFS are used. You should supply your own help context file whose name must match that in HCFILE.PAS, or edit HCFILE. You don't have to define all contexts at once, TOYPREFS will cover the ones missing. Make sure you use toyPrefs BEFORE your HelpCtx file (unit X; uses toyPrefs, MyHelpCtx, ...). You might have to rebuild sometimes. See HELPTEST.TXT for a list of help contexts. Also notice that hcDosShell is defined in Borland's APP unit, which easily leads to conflicts. Make sure your own help context file is used after any other file defining help contexts. Suggestions Ü ßßßßßßßßßßßßßßßß Copy TOYCFG to your project directory and edit to your liking if a project calls for a different setup than you'd normally use. Put toyPrefs very early in all uses lists, or your help context values will be zero. Notice how toyPrefs always preceeds HelpCtx in the demonstration programs' uses lists. Inherit TToyApp and make a new unit (layer) that adds more functionality, without editing TOYAPP itself. This way you can easily upgrade your TVToys and still get an inheritable application with lots of functionality burned in. If you need to inherit from another application object, copy TOYAPP.PAS and edit it so that TToyApp inherits that other application object. The Info dialog and the Internal font choices are for demonstration purposes. Use your choice of "Toggle video lines", "Select video mode" and "Select font" only, or look at RESTEST. Don't use disk file fonts, put them in a resource file and undefine DiskFonts in TOYCFG to save a lot of code. Assume that your mouse driver contains bugs, they all do. NewMouse can help, but if the mouse driver is really buggy, there is little one can do except change the driver. Avoid all drivers not made by Microsoft or Logitech, they are usually just trash. Switch to a Microsoft or Logitech driver, they should work with all mice. MS-DOS 6 and Windows come with a Microsoft driver, and Logitech drivers are available electronically. Turbo Pascal 6.0 users Ü ßßßßßßßßßßßßßßßßßßßßßßßßßßß All the code can be converted for use with Turbo Pascal 6.0, if you are desperate. The worst problem is that Borland Pascal 7.0 clears the data segment before the program starts, which I make heavy use of. This means that the code won't work as intended even if it compiles with TP6. Off hand, I can think of VideoList, VesaVersion, VesaScanningSupported, OldFront and OldCount causing trouble. Here is an example of what you have to do: const OldFront : Integer = 0; OldCount : Integer = 0; I have seen code that clears the data segment for you, though. VIDEOTST uses an Application^.ExecuteDialog, check out TVEDIT.PAS in your TP6 TVDEMOS directory for an equivalent ExecDialog procedure. You might want these, too: const Seg0040 : Word = $0040; SegB000 : Word = $B000; SegB800 : Word = $B800; Compatibility Testing Ü ßßßßßßßßßßßßßßßßßßßßßßßßßß This code has mainly been tested on three machines: þ A 286 with with a Chips VGA card and an EGA monitor. Also tested with a Video7 card which provided 132 column output on the EGA monitor. No protected mode. First development machine. þ An IBM PS/1 486/33 with Tseng VGA chips. VERY slow at scanning. First protected mode attempts. þ A Dual monitor Compaq 386 Portable with a Video7 VGA card and Super VGA monitor. Current development platform. I have tested three mouse drivers on the Video 7 equipped 386: Microsoft Mouse driver version 8.20 and earlier does not work with extended text modes, it assumes them to be graphics modes. All Logitech mouse drivers should work with all text modes, I have only tested version 6.20. Genius mouse driver version 10.20 does not work, it doesn't realize what width the screen is. NewMouse fixes all this, but if the mouse driver is buggy (like Genius) there might be minor annoyances like the cursor jumping or temporarily disappearing at mode switches. I suggest that you check what mouse driver you are using, there are usually several on every hard disk. I use Microsoft's driver version 8.20 even though it's buggy, but you know what you get. VESA compatibility was tested using a PD Video7 TSR on the 386. UNIVESA.EXE by Kendall Bennett is NOT a full VESA implementation, it focuses solely on graphics video modes and will not provide the necessary information to avoid having to physically test every video mode. If you promptly have to use UNIVESA or UNIVBE release 4.2 or earlier on a Video 7 video card, make sure you define V7UniVesaKludge, since there is a Video 7 specific bug in UNIVESA. Future versions of UNIVESA will probably not suffer from this. Coding Style Ü ßßßßßßßßßßßßßßßßß Oh well, I do my best. I have tried to change my usual style slightly, for your sake. I started using fully qualified names, so you would know where to look for the code. I now realize the browser will be of much more help, so the qualified names are gone. There is no need to use fully qualified names, as there are no name collisions. I also started writing "Byte" instead of "byte", and so on for word, boolean etc, but I doubt that I am consistently using that style. The Video and VESA code is littered with {$IFDEF} for VESA, V7 and DPMI support. I might make full support mandatory and remove all but the DPMI IFDEFs. Let me know what you think. I have changed the names of most procedures at least once, so there might be references to old names in the documentation. Some code has been moved, so some references to files might be misleading. I have tried to spot most errors. You will probably feel that I am overindenting my code, sigh. Protected Mode Information Ü ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß The code was originally developed and tested on a 286 without protected mode support. Development has now moved to a 386 with 4 Mb of memory and a Video7 VGA card. All the code has been tested in protected mode, especially the Video7, Vesa and NewMouse code, and it works for me... Overlay Information Ü ßßßßßßßßßßßßßßßßßßßßßßßß You can overlay all units EXCEPT NewMouse, which contains an interrupt handler. It's a very small unit anyway, about 530 bytes. PC Video Modes Ü ßßßßßßßßßßßßßßßßßßß Turbo Vision only knows about three video modes, and there is a reason for that. These three are the only "standard" 80 column text modes, all other video modes are manufacturer specific. All modes are referred to by number, and the three Turbo Vision knows about are number 2, 3 and 7. Numbers can range from 0 to 127, where most of the first 19 are used by VGA cards. Numbers above 19 are used for extended video modes. Naturally, all manufacturers number their video modes differently, even if the screen size is the same. This means that you can't easily set a 80x60 video mode, for instance, since you wouldn't know what mode number to refer to unless you know the brand of the video card. You might not even know if the video card supports 80x60, but your program could find out. The monitor might not like 80x60 either, but a program cannot detect if a VGA monitor is suited for Super VGA video modes. There is now a new function, FindSimilarVideoMode(Cols,Rows), that will return the number of a video mode which is about Cols wide and Rows high. You can pass the mode number to SetSpecialVideoMode directly. Remember to use ScanVideoModes first, and make sure StoreModeData in TOYCFG.PAS is defined (it isn't by default). FindSimilarVideoMode uses a simple approach, but you can write your own algorithm. Video 7 Ü ßßßßßßßßßßßß This package supports Video 7 video cards. Certain design decisions were made with Video 7 in mind (overly complicating things). Video 7 cards do not recognize any text video mode numbers above 19 (see above) if you use the normal BIOS interrupt call, you must use a special Video 7 call. On the other hand, video mode 1 corresponds to the last Video 7 specific video mode set with such a Video 7 call. That is, if you set a 80x60 video mode with a Video 7 interrupt (the only way), you can use a normal BIOS call setting mode 1 and get the last Video 7 specific mode set. This also means that if you ask a Video 7 BIOS in the normal way what video mode is set, the answer will be 1 for all extended video modes. This creates problems as mode 1 is a standard 40x25 mode. Sometimes you will get a 40x25 mode when you least expect it, usually when you terminate your program abnormally inside the IDE. This only happens if you have a Video 7 video card. The Improved Help File Ü ßßßßßßßßßßßßßßßßßßßßßßßßßßß HELPFILE is an improved help file with back tracking and custom key help screens. See HELPTEST for a demonstration. The HelpFile code is a modified TP7 HelpFile with some bugs removed, see the header in HELPFILE. There should be no difficulty upgrading your programs to use the improved HelpFile, just make your application object inherit TToyApp and define a status line, see HELPTEST. Make sure you set HelpFileName to your application's Help file name and everything will be taken care of for you. Extended Video Mode Support Code Ü ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß The units Video, ModeDlg, TVVideo and VESA provide extended video mode support. See VIDEOTST and RESTEST for a demonstration. You CANNOT use smFont8x8 and smSpecialFont8x8 with TVToys any more. REMOVE all references to them. Video7 and VESA support are defined automatically. Modify TOYCFG.PAS to your liking. VESA function calls take priority. CheckVideoType will still look for all video types supported, though. You can check for only some video types by changing the VideoTypesToCheck variable. CheckEVGA will always be called, this works with most computers, but not the Vesa and Video 7 checks. This is a Video BIOS problem on some machines. The Vesa implementation might also be so buggy that the user rather lived without it. VideoTypesToCheck lets you configure video support at run time. How it all works: (This is a very long description! If you inherit TToyApp all you have to do is copy the uses list, some HandleEvent lines, the cmXXXX list and some menu code from VIDEOTST to make things work) First call CheckVideoType. This will set VideoType, Video7 and VesaVersion to appropriate values. If VesaVersion is zero, no Vesa support was detected. (TToyApp.Init does this for you). You can call CheckVesa, CheckVideo7 and CheckEVGA yourself if you want greater control, or use VideoTypesToCheck. Call SetupVideoList to construct a list of available video modes. If a VESA video card is detected, attempts will be made to directly inquire about available video modes. This might not be supported by the video card since it is not mandatory in the VESA standard. If the VESA test fails, ScanEVGAModes will be used to determine video modes. ScanEVGAModes takes a somewhat simple and stupid approach to determine what video modes are available: It tries to set every video mode from 0 to 127 to see if the BIOS responds by setting more or less legal values in the BIOS data segment. This might not work all that well all the time, see VIDEOTST.PAS for a list of caveats. The only other way (apart from VESA) of determining available video modes is to use lists of all video modes for all cards manufactured. Use SelectVideoModeDialog to put up a TV dialog that lets the user choose from available modes. To avoid unnecessary scanning, you can use the SaveVideoModes and LoadVideoModes commands to save and restore the scanning results to/from disk. If you don't like the format of the information (not very easy to read, maybe?) presented in the selection dialog, make changes in the AddMode procedure in MODEDLG.PAS. To use the video mode routines, use this as a checklist: 1) Always start out by determining the current video system. (TToyApp.Init handles all this automatically) CheckVideoType; (* Always start with this command *) Or define AutoCheckVideoType in TOYCFG.PAS, but then you can't overlay VIDEO.PAS anymore. 2) Check that we're in fact dealing with a EGA/VGA before using ScanEVGAModes. You can simply shut off the command: if VideoType=Other then DisableCommands([cmVideoMode, cmVideoLines, cm14p, cm16p]); 3) Put up some sort of warnings before we start scanning... HasToScan is false if we already know what video modes are available. VesaScanningSupported is true if we don't have to physically set every video mode to see if it is supported. You might want to put up different warnings depending on what will actually happen, see RESTEST for a simple example. 4) To scan and then select video mode: SetupVideoList; SelectVideoModeDialog; If you use resources, try this: SetupVideoList; SelectVideoMode( PSelectVideoModeDialog(RezFile.Get('VideoModeDialog'))); 5) To save the video modes found during scanning, use StoreVideoModes: var S : TDosStream; RegisterObjects; S.Init('VIDEOTST.INI', stCreate); StoreVideoModes(S); S.Done; Use LoadVideoModes to restore them. See RESTEST for an advanced example. 6) Remember to change all your old references to SetScreenMode to SetSpecialScreenMode, but... 7) YOU CANNOT USE smFont8x8 or smSpecialFont8x8! TVToys does not support this any longer, there is now a ToggleVideoLines procedure. You can also use the SetInternalFont(Internal8x8Font) procedure. 8) This code has to trash Turbo Vision's StartUpMode to get by "internal security". Since Video7 cards use video mode 1 to signify the last extended video mode used, special care must be taken to provide intelligent StartupMode behaviour if Video7Support is defined. TToyApp uses VideoState objects and handles everything transparently for you. 9) If you want to be on the safe side and not immediately detect all sorts of video hardware, look at RESTEST.PAS for some ideas. Custom Fonts Ü ßßßßßßßßßßßßßßßßß FontFile is a unit that lets you access fonts stored on disk in a variety of formats. Current supported formats are version 1.0 and version 2.0 of Michael J Mefford's (Ziff Communications) FontEdit (source published in PC Magazine and available almost everywhere) and my own format. I have a Turbo Vision font editor that will be made available sometime, but you can try to talk me out of a beta. I also have about 60 fonts, a few of which are useful. Defining the font is only possible on EGA/MCGA/VGA cards. You can do it on Hercules cards too, but I have lost all my documentation files. The font is only temporarily changed. If the video mode changes, the font changes to a standard video card one. Shelling to DOS provides ample opportunity to change the video mode. FontDlg.SelectFontDialog(FontPath:String; Res:PResourceFile) searches for fonts in the current directory and in the Res resource file and presents a list for the user to choose from. You have to define DiskFont if you want to look on disk and ResFont if you want to look in the resource file. You can define both at once if you like. If you don't, pass dummy parameters like '' and Nil. SelDiskFont is 3K code. See RESTEST for a resource example. The FontPath directory should have one or more font COM files in any of the above formats. Use the empty string ('') if you want to search the current directory, or ExeDir to search the executable file's directory (if you inherit from TToyApp). The resource file must contain a StringCollection resource saved under the key FONTLIST (see TOYPREFS and RESTEST) with the keys of the TFontFiles available in the stream. You can load a disk font with the LoadDiskFont procedure, but if that fails there will be an error message box. To load a specific font without getting an error message if it fails, use the FontFiles unit like this: var Font : FontFile; (* Font.Read uses "Error" MsgBox on error *) if Font.DoRead(FileName) then Font.Display; You can also directly load a font from a stream, a resource file for instance: RegisterFontFile; LoadResFont(RezFile, 'CHIC12'); The DoubleString unit provides a special kind of string, actually one block with two strings right after another. This is used in the font selection dialog to keep track of corresponding file names and resource keys. Run VIDEOTST and RESTEST to see these units in action. Scroll Unit Ü ßßßßßßßßßßßßßßßß When you drag a normal Turbo Vision scrollbar, the owner of the scroll bar is not updated until you release the scroll bar's thumb. A TScrollingBar on the other hand lets you interactively see the changes by notifying the owner as soon as the thumb moves. If you like this behaviour a lot, there is a procedure OnlyScrollingBars that makes TScrollbar work interactively too. It uses a VMT trick to accomplish this. The TScrollingBar is completely backward compatible. The only difference is the extra cmScrollBarChanged messages sent while dragging. See the Video Palette dialog in RESTEST for a demonstration of interactive dragging. The NewMouse Unit Ü ßßßßßßßßßßßßßßßßßßßßßß NewMouse is a quick and dirty solution for buggy mouse drivers that don't know a thing about any video modes except the "standard" ones. If you have a Logitech mouse driver, you will probably never have any problems, but others will. Most mouse drivers have problems with video modes they are not familiar with. They might not let the cursor travel across all the screen, or worse, think that what is in fact a text mode is a graphics mode and present a "graphics mode" mouse cursor (a bunch of garbage). NewMouse simply contains its own routines for drawing a mouse cursor. NewMouse relies on BIOS information to determine the width of the screen. The screen is always assumed to be in text mode. If you want to switch to graphics mode, you have to take some precautions. See NEWMOUSE.PAS. NewMouse has no hardware cursor support, so the cursor will always be drawn in the standard text mode way. You cannot change the appearance of the mouse cursor without turning NewMouse off by using UseNewMouse(False). Since NewMouse solely focuses on drawing a mouse cursor, there will still be a text mode mouse cursor if you run a TV application windowed (not full screen) in Windows enhanced mode. Looks funny. Don't know what to do about it. To use NewMouse, all you have to do is define UseNewMouse in TOYCFG. This makes TToyApp use NewMouse and automatically turns it off in DOS. It seems you cannot use NewMouse if you want to debug with TDX v3.2, as TDX doesn't like changing the mouse interrupt? You CANNOT overlay the NewMouse unit. EXE Stream Unit Ü ßßßßßßßßßßßßßßßßßßßß The Exe stream unit allows you to add your own resources to an EXE file. You can now put your Help file in the EXE file by just appending it as would it be a resource file and defining ExeHelp before recompiling TOYAPP. If you're making a DPMI app, you have to recompile TVHC with the extended TVToy HelpFile to create help files with special "back links" used by ExeStream. All EXE stream seeks are relative to the resource's first header byte. You can also easily add your own resources as long as you follow Borland's system for EXE additions, see EXESTRM Serial Performance Ü ßßßßßßßßßßßßßßßßßßßßßßß The serial stream is a simple buffered interrupt driven serial port receiver and transmitter. It only handles one serial port at a time, there is no flow control and it suffers from the usual IRQ problem that makes COM1 and COM3 interfere with each other, and COM2 and COM4. The assembler interrupt handler manages 115200 bps on a 286/6, but without flow control you'd better be careful... It knows about 16550's, but you have to switch them on yourself. I currently have only one serial port (and an internal modem). I have been thinking of adding flow control, but I can't test it and I don't need it (yet?) so it's up to you. I thought I could fix the IRQ problem too, but I can't test it... I've copied text from the 386/20 to the 286/6 and back again at 115k, so that should work. I tried sending to Telix, but Telix lost the first few characters at 115k and scrolling the screen lost more characters. Normal speeds (<40k) works nicely. Serial Coding Ü ßßßßßßßßßßßßßßßßßß The serial stream is easy to work, it's like any stream. Use Read to read and Write to write! Begin with a call to Init, there are two kinds: Init(aNumber:Integer); (* 1-4 for COM1-COM4 *) InitPort(Port, IRQ:Word); (* i/o port and IRQ value *) The COM selection dialog uses the latter, it's more powerful but also more dangerous. The first relies on the BIOS to provide correct values, which often seems not to be the case (read the serial FAQ, some jungle out there!) Now you have to decide on speed and parity settings: (* 19200 bps, no parity, 8 data bits, one stop bit *) SetBaud(19200, None, 8, 1); To use 16550s: Use16550(True); To make a loopback test: if not LoopBackTest then Fail; Set RTS high if CTS high: if (GetModemStatus and CTS) <> 0 then ModifyReg(MCR, RTS, True); (* Modem Control Register *) Once you've initialized the port, RTS and DTR are on (true) and receiving is enabled. All reads and writes are buffered, so Write will just put it in a buffer and Read will read from another buffer. If the buffer is empty, a Read will stall until there is enough data. If the buffer is full, a write will stall until there is room enough to copy the data to the buffer. Note that without flow control the serial port will start transmitting immediately even if there is nothing connected to the serial port. I included a serial port selection dialog. It's rather good as far as COM port selection dialogs go, but there are no speed or parity options as my application used preset values. Should get you started though. There is a separate speed and parity dialog in SERTEST. SERTEST is a silly simple serial test program, it lets me logon to my campus UNIX machine, but little more than that. VideoModeChanged Variable Ü ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß The procedure TVVideo.VideoModeChanged is called whenever the video mode has changed in the TV environment (whenever InitTVVideo is called). This is a procedure pointer, so you can hook your own code if you want. The default is to do nothing, but you can point it to FontDlg.ReloadLastFont or TVPal.ReloadLastPalette or FontDlg.ReloadFontAndPalette to achieve different results. You have to do this explicitly, it's no longer done automatically. See RESTEST and VIDEOTST for two examples. Changes Ü ßßßßßßßßßßßß 1.1: ColorTxt draw method changed. Mini shadows. 1.3: Docs: Porting, Suggestions and PC Video modes sections added in this file. Prefs: All conditionals in one file, TOYCFG.PAS. You should delete all other conditional defines, ie in Compiler Options. Remember to edit your include path if you compile from another directory. TOYPREFS added. Fonts: Custom fonts and font files. Streamable fonts. Font selection dialog. RESTEST font resource demo added. Help: SwitchToTopic and PopHelp combined to ShowHelp. Last highlighted topic remembered in HelpFile. Help contexts are not commented any more, see TOYCFG, TOYPREFS and HCFILE and the Porting section. Borland empty topic bug found and fixed. Fixes to enable Range Checking. NewMouse: NewMouse doesn't use code segment any more, DosShell bug fixed. Use UseNewMouse ONLY when mouse cursor is hidden. You don't have to (you should NOT) put NewMouse in the uses list if you use TToyApp and define UseNewMouse. Video: TVVIDEO NO LONGER SUPPORTS smFont8x8, use ToggleVideoLines. FindSimilarVideoMode added to ModeDlg. Current mode read from BIOS, not BIOS data (ATI fix from D Baldwin) Video.VideoTypesToCheck controls (run-time) what video checks will actually be performed, default is all supported. A big DPMI bug from the Vesa code fixed. Thanks to Marek Bojarski for putting up with me. RESTEST and CHECKVT added. Other: TOYAPP added. Inherit TToyApp for easy application porting. EXE stream added, lets you put the help text in the EXE. RESTEST font resource, config file app demo added. 1.4: Help: Another Borland bug fixed, topic link spilling. Last highlighted topic bug fixed. Video: COLORBOX added, instant color selection with color propagation. PAL, TVPAL added: Palette routines, TV palette changing dialog. RESTEST updated to demonstrate TVPal and ColorBox. ReloadLastFont variable GONE, you must now EXPLICITLY assign a value to VideoModeChanged. See the VideoModeChanged section. Other: STRMREC created, all stream registration records in one file. SCROLL, scrollbars with instant dragging response. TVUTILS, odd bits and pieces, validators. VideoModeChanged section added. 1.5: Serial: Serial stream added COM port selection dialog added Simple serial demonstration program added, SERTEST 2 serial sections added Help: Help texts for the Color Selection Dialog added Added back link so DPMI ExeHelp works ExeStream: Found a DPMI bug, fixed HELPFILE to work with ExeStream Other: FlushSmartDrive added to toyUtils Delay moved to TVUtils, fixed Q+ problem (again) Credits Ü ßßßßßßßßßßßß All dialogs designed and generated with Dialog Design 4.0 available on Compuserve and by anonymous ftp to garbo.uwasa.fi in directory /pc/turbovis and oak.oakland.edu in /pub/msdos/turbovis. Thanks to David Baldwin, who also contributed the original ColorTxt unit and an ATI fix. NewMouse, VESA and DPMI bug fixes and lots of other suggestions from Marek Bojarski without whom TVToys would be buggier than a mouse driver. I finally found a VESA TSR for Video7 that contained TEXT mode support. Thanks to Gary Lorenson. All Video7 and VESA information derived from Ralf Brown's famous interrupt listing. DPMI information from Borland source and the official DPMI specifications. This project would have been utterly impossible without the help of Borland's run time source, or for that matter, Borland Pascal 7.0... Author, Support, Info, Bugs etc Ü ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß If you would like to see further enhancements to this code, write me a letter telling me what you like and don't like, what works and what doesn't, and what improvements you want to see. Since I am a computer science student with no income, I would very much appreciate a financial contribution. Get in touch with me if you feel that you want to support this package financially. Unfortunately a check costs me SEK 70 (almost $10) to cash in, so cash or wire is best for me! I accept orders for the latest version and will send invoices by arrangement. Bug reports, enhancements, contributions, credits, postcards and money are always welcome! My internet address: d91-pbr@nada.kth.se You can reach me from CompuServe by sending mail to: INTERNET:d91-pbr@nada.kth.se Mail: Peter Brandstr”m (Peter Brandstrom) Roslagsgatan 10 S-113 55 Stockholm Sweden, Europe To Do List Ü ßßßßßßßßßßßßßßß Video mode selection dialog help texts produced by native English speaking person. Volunteers? Merging HelpTest and VideoTst using the above help texts for demonstration. Easier internationalization (is anyone really into this?) More toys? (I have a 64K+ editor under construction)